"""
@File    : father1.py
@Author  : WorldWind(1772830365@qq.com)
@Time    : 2025/7/14
@Address : ChangSha - BoWeiFeng
@Date    : 2025/7/14 下午2:14
"""


class Father:
    nation = 'USA'
    skin = 'white'
    __password = '123'  # 私有属性不能被子类继承

    def __init__(self, name):
        self.name = name
        print(f"My name is {self.name}")

    def sing(self):
        print('I like singing!')

    @staticmethod
    def run():
        print('father ... run ...', Father.__name__)

    @classmethod
    def eat(cls):
        print('father ... eat ...', cls.__name__)

    def __ShowPassword(self):  # 私有方法不能被子类集成
        print(f'密码是: {self.__password}')


class Son(Father):
    def __init__(self):
        pass

    def sing(self):
        print("I don't like singing")

    def __del__(self):
        print('This is __del__ method. The Son class has been recycled')


s = Son()
print(s.eat)
# 通过Son()调用父类中的sing方法
super(Son, s).sing()
